<template>
    <f7-page @page:beforein="pageBeforeIn">
		
		<!-- <p id="demo-determinate-container"></p> -->
        <f7-navbar>
            <f7-nav-title title="任务"></f7-nav-title>
        </f7-navbar>
        <div style="height:95%" class="list-block ptr-content">
            <div class="ptr-preloader">
                <div class="preloader"></div>
                <div v-show="isProgressbar" class="ptr-arrow"></div>
            </div>
            <f7-list media-list style="margin:0px;width:100%">
                <f7-list-item
                        link="/Todo/LocaleCheck"
                        title="现场检查"
                        :text="localCheckText"
                        :after="localCheckAfter">
                </f7-list-item>
                <f7-list-item
                        link="/Todo/QualityMeasure"
                        title="实测实量"
                        :text="qualityMeasureText"
                        :after="qualityMeasureAfter">
                </f7-list-item>
            </f7-list>
        </div>
    </f7-page>
</template>

<script>
    import todoLoad from '@/mixins/todoLoad.js';
    import eventBus from '@/utils/eventBus.js';
    import store from '@/store';
    export default {
        store: store,
        mixins: [todoLoad],
        data: function(){
            return {

            }
        },
        methods: {
            pageBeforeIn: function () {
                this.loadCount();
            },
        },
        computed: {
            localCheckText: function() {
                return this.localProcessedCount + ' 已办 \xa0\xa0' + this.localCcCount+ ' 抄送';
            },
            localCheckAfter: function() {
                return this.localUnprocessedCount + ' 未办';
            },
            qualityMeasureText: function() {
                return this.qualityProcessedCount + ' 已办 \xa0\xa0' + this.qualityCcCount+ ' 抄送';
            },
            qualityMeasureAfter: function() {
                return this.qualityUnprocessedCount + ' 未办';
            }
        },
        mounted: function () {
            var self = this;
            self.loadData();
            eventBus.$on('load-count', self.loadCount);
            eventBus.$on('load-data', self.loadData);

            var ptrContentProcessed = this.Dom7('.ptr-content');
			ptrContentProcessed.on('ptr:refresh', function(e) {
				e.detail();
                self.loadData();
			});
        },
        beforeDestroy () {
            eventBus.$off('load-count',this.handle);
            eventBus.$off('load-data',this.handle);
	    },
    }
</script>

<style scoped>

</style>